<div class="panel panel-default">
  <!-- Default panel contents -->
  <div class="panel-heading">车展场租费用
    <?php if (in_array($action, array('edit')) && in_array($projectData['settleAuditRs'], array(-1,0,3)) && !$rentList) {?>
    <a class="btn btn-default col-md-offset-10" onclick="newWindow('新增车展场租','<?=printUrl('CarRent','add', array('procId'=>$procId,'projectId'=>$projectId))?>',400,450)">新增</a>
    <?php }?>
  </div>
  <table class="table table-bordered">
    <thead>
      <tr>
        <th class="bg-primary text-center">场租单价（元/㎡）</th>
        <th class="bg-primary text-center">场租面积（日产+启辰）(㎡)</th>
        <th class="bg-primary text-center">场租总额</th>
        <th class="bg-primary text-center">参展专营店数量（不含启辰店）</th>
        <th class="bg-primary text-center">单个专营店场租出资上限</th>
        <th class="bg-primary text-center">专营店出资总额</th>
        <th class="bg-primary text-center">启辰店出资总额</th>
        <th class="bg-primary text-center"><span data-toggle="tooltip" data-placement="top" title="RMP支持场租费用=场租总额-专营店出资总额-启辰店出资总额">RMP支持场租费用</span><span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span></th>
        <th class="bg-primary text-center">预算审核结果</th>
        <?php if (in_array($action, array('edit','audit'))) {?>
        <th class="bg-primary text-center">操作</th>
        <?php } ?>
      </tr>
    </thead>
    <tbody>
    <?php foreach($rentList as $k => $v): ?>
      <tr>
        <td class="text-center"><?php echo $v['unitPrice']; ?></td>
        <td class="text-center"><?php echo $v['areaSize'] ?></td>
        <td class="text-center"><?php echo $v['budgetApply'] ?></td>
        <td class="text-center"><?php echo $v['storeNum'] ?></td>
        <td class="text-center"><?php echo $v['oneStorePrice'] ?></td>
        <td class="text-center"><?php echo $v['budgetStoreTotal'] ?></td>
        <td class="text-center"><?php echo $v['budgetQiTotal'] ?></td>
        <td class="text-center"><?php echo $v['budgetRmpSupport'] ?></td>
        <td class="text-center"><?php echo $v['budgetAuditStr'] ?></td>
        <?php if (in_array($action, array('edit'))) {?>
        <td class="text-center">
          <!-- 没有预算审核，以结算审核为判断基准 -->
          <?php if (in_array($v['settleAuditRs'], array(-1,0,3) )) {?>
          <a class="btn btn-default" onclick="newWindow('修改车展场租','<?=printUrl('CarRent','add', array('id'=>$v['id']))?>',400,450)" role="button">修改</a>
          <a class="btn btn-default" onclick="ajaxConfirmSubmit('您确定要删除此车展场租吗？<br>此操作不可撤销','<?=printUrl('CarRent','del')?>',{'id':<?=$v['id']?>})">删除</a>
          <?php } ?>
        </td>
        <?php } ?>
        <?php if (in_array($action, array('audit'))) {?>
        <td class="text-center">
          <?php
          $options = $this->config->item('budgetAuditOptions');
          $extra = ' class="form-control" style="width:70px;" ';
          if ($v['settleAuditRs'] > -1 || $this->user['userRole'] < $v['budgetAuditRole']) {
            $extra .= " disabled";
          }
          echo form_dropdown('rent['.$v['id'].'][budgetAuditRs]', $options, $v['budgetAuditRs'], $extra);
          ?>
        </td>
        <?php } ?>
      </tr>
    <?php endforeach; ?>
    </tbody>
  </table>
</div>
<script type="text/javascript">
$(function () {
  $('[data-toggle="tooltip"]').tooltip();
})
</script>